package com.laamella.syntherface.synths.alesis.micron.model;

import com.laamella.syntherface.synths.midi.MidiInterface;
import com.laamella.syntherface.synths.models.NrpnParameterModel;
import com.laamella.syntherface.synths.models.ParameterModel;
import com.laamella.syntherface.synths.models.ParameterType;

@SuppressWarnings("serial") public final class Oscillator {
	public final ParameterModel waveform;
	public final ParameterModel waveShape;
	public final ParameterModel octave;
	public final ParameterModel transpose;
	public final ParameterModel pitch;
	public final ParameterModel pitchwheelRange;

	public final int number;

	/**
	 * 
	 * @param patch
	 * @param number
	 *                1..3
	 */
	Oscillator(MidiInterface midiInterface, int number) {
		this.number = number;
		int offset = (number - 1) * 6;
		String oscillatorName = "oscillator " + number + " ";

		waveform = new NrpnParameterModel(oscillatorName + "waveform", midiInterface, 11 + offset, new ParameterType.List("sine, tri/saw, pulse"));
		waveShape = new NrpnParameterModel(oscillatorName + "wave shape", midiInterface, 12 + offset, ParameterType.PercentageAlsoNegative);
		octave = new NrpnParameterModel(oscillatorName + "octave", midiInterface, 13 + offset, new ParameterType.IntegerRange(-3, 3));
		transpose = new NrpnParameterModel(oscillatorName + "transpose", midiInterface, 14 + offset, new ParameterType.IntegerRange(-7, 7));
		pitch = new NrpnParameterModel(oscillatorName + "pitch", midiInterface, 15 + offset, new ParameterType.IntegerRange(-999, 999));
		pitchwheelRange = new NrpnParameterModel(oscillatorName + "pitchwheel range", midiInterface, 16 + offset,
				new ParameterType.IntegerRange(0, 12));
	}
}
